#include<stdio.h>
#include<unistd.h>

int main()
{
  pid_t id = fork();
  int i = 0;
  if(id == 0)
  {
    while(1)
    {
      printf("i am child! pid:%d, ppid:%d \n",getpid(), getppid());
      sleep(1);
    }
  }
  else{
    while(i < 5)
    {
      printf("i am father! pid:%d, ppid:%d \n",getpid(), getppid());
      sleep(1);
      ++i;
    }
  }
  return 0;
}
